<?php

// 是否存在 1收藏 2没有收藏

function dr_quan_tag_favorite($id, $favorites, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang5.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">已藏</div>';
	    }else{
			return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">收藏</div>';
		}
    } 
	return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">收藏</div>';
    
}
function dr_quan_tag_favorite_ding($id, $favorites, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang5.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">已藏</div>';
	    }else{
			return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">收藏</div>';
		}
    } 
	return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">收藏</div>';
    
}
function dr_quan_tag_zan($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan2.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">已赞</div>';
	    }else{
			return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">点赞</div>';
		}
    } 
	return '<div class=" d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-kuan-juzhong"><img src="{HOME_THEME_PATH}quan/img/zan.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div><div class="d-shang-4 d-wenzi-12">点赞</div>';
    

}
function dr_quan_tag_zan_ding($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan2.png" width="30" class="d-shang-4"/></div><div class="d-shang-4 d-wenzi-12">已赞</div>';
	    }else{
			return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan.png" width="30" class="d-shang-4"/></div><div class="d-shang-4 d-wenzi-12">点赞</div>';
		}
    } 
	return '<div class="d-zuo-10 d-shang-10 d-gao-40 d-kuan-40 d-yuanjiao-50 d-beijing-hei-f0 d-wenzi-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan.png" width="30" class="d-shang-4"/></div><div class="d-shang-4 d-wenzi-12">点赞</div>';
    

}
//圈子点赞id
function dr_quan_tag_zan_dingid($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
	    }else{
			return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
		}
    } 
	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
    

}
//列表点赞
function dr_quan_tag_zan_list($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<img src="'.HOME_THEME_PATH.'quan/img/zan3.svg" width="24px" height="24px" class="d-yuanjiao-50 d-div-zuo"/>';
	    }else{
			return '<img src="'.HOME_THEME_PATH.'quan/img/zan.svg" width="24px" height="24px" class="d-yuanjiao-50 d-div-zuo"/>';
		}
    } 
	return '<img src="'.HOME_THEME_PATH.'quan/img/zan.svg" width="24px" height="24px" class="d-yuanjiao-50 d-div-zuo"/>';
    

}
//列表点赞下载
function dr_quan_tag_zan_list_xiazai($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
	    }else{
			return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
		}
    } 
	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> 点 赞 </div>';
    

}
//加入圈子
function dr_quan_tag_joins($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_quan_cart')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-shang-30 d-neikuang-5-10 d-beijing-baise d-yuanjiao-20 pull-right d-zitiyanse-hui"> ✓ 已 加</div>';
	    }else{
			return '<div class="d-shang-30 d-neikuang-5-10 d-beijing-baise d-yuanjiao-20 pull-right d-zitiyanse-hei"> + 加 入</div>';
		}
    } 
	return '<div class="d-shang-30 d-neikuang-5-10 d-beijing-baise d-yuanjiao-20 pull-right d-zitiyanse-hei"> + 加 入</div>';
    
}
//加入圈子id
function dr_quan_tag_joinsid($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_quan_cart')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> ✓ 已 加</div>';
	    }else{
			return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> + 加 入</div>';
		}
    } 
	return '<div class="d-kuan-50 d-hanggao-30 d-wenzi-juzhong d-shang-10 d-wenzi-12 d-beijing-hei d-yuanjiao-20 pull-right d-zitiyanse-bai"> + 加 入</div>';
    
}
//点赞圈子
function dr_quan_tag_quanzan($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_quan_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '已赞';
	    }else{
			return '点赞';
		}
    } 
	return '点赞';
    
}
function dr_quan_tag_favorite_dibu($id, $favorites, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class=" d-yuanjiao-50 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang5.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
	    }else{
			return '<div class=" d-yuanjiao-50 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
		}
    } 
	return '<div class=" d-yuanjiao-50 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/shoucang4.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
    
}
function dr_quan_tag_zan_dibu($id, $zan, $uid = 0) {

    !$uid && $uid = \Phpcmf\Service::C()->uid;

    if ($id && $uid){
		$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_'.'quan_form_son_zan')->where('uid', $uid)->where('cid', $id)->countAllResults();
		//SITE_ID.'_'.'quan_form_son'
		//$rt = $this->db->table($tablename.'1_quanzi_cart')->where('cid', $id)->where('uid', $id)->countAllResults();
	  //$rt = \Phpcmf\Service::M()->db->table(SITE_ID.'_tag_favorite')->where('uid', $uid)->where('cid', $id)->countAllResults();
	    if ($rt){
	    	return '<div class="  d-yuanjiao-50  d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan2.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
	    }else{
			return '<div class="  d-yuanjiao-50  d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
		}
    } 
	return '<div class="  d-yuanjiao-50 d-kuan-juzhong"><img src="'.HOME_THEME_PATH.'quan/img/zan.png" width="30" class="d-shang-4 d-kuan-juzhong"/></div>';
    

}
/*function d_jiangli($data, $uid = 0) {
	//dr_debug('$data', $data);
	!$uid && $uid = \Phpcmf\Service::C()->uid;
	if ($data['miaoshu'] && $uid){
		return '我的'.$data['miaoshu'].'';
	}
	//return '我的'.$data['miaoshu'].'';
}*/